interface MdcTableData {
    title: string
    xml: string
}

interface MdcCaseData {
    title: string
    desc: string
    jsx: string
}

type MdcData = string | MdcCaseData | MdcTableData

function processMdcCaseString(caseString: string): MdcCaseData {
    return caseString as any
}

export function processMdcString(md: string): MdcData[] {

    let list: MdcData[] = [];

    const cases: string[] = [];

    md = md.replace(/:::case((?:.|\t|\r|\n)+?):::/g, (...args) => {
        cases.push(args[1])
        return ':::SEPARATOR:::'
    })

    list = md
        .split(":::SEPARATOR:::")
        .reduce((ret, item, index) => {
            if (!!item) {
                ret.push(item)
            }
            ret.push(processMdcCaseString(cases[index]))
            return ret
        }, [] as MdcData[])

    console.log(list)


    return []
}
